package com.quasar.hpatient.alarmUtils;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Vibrator;

import com.quasar.hpatient.Jpush.NotificationUtils;
import com.quasar.hpatient.model.litePalmodel.MedicationInfoDatadb;

import org.litepal.crud.DataSupport;

import java.util.List;


/**
 * Created by loongggdroid on 2016/3/21.
 */
public class LoongggAlarmReceiver extends BroadcastReceiver {

    private MediaPlayer mediaPlayer;
    private Vibrator vibrator;
    Context context;
    @Override
    public void onReceive(Context context, Intent intent) {
        this.context=context;
        // TODO Auto-generated method stub
        String msg = intent.getStringExtra("msg");
        long intervalMillis = intent.getLongExtra("intervalMillis", 0);
        if (intervalMillis != 0) {
            AlarmManagerUtil.setAlarmTime(context, System.currentTimeMillis() + intervalMillis,
                    intent);
        }
        int flag = intent.getIntExtra("soundOrVibrator", 0);
//        Intent clockIntent = new Intent(context, ClockAlarmActivity.class);
//        clockIntent.putExtra("msg", msg);
//        clockIntent.putExtra("flag", flag);
//        clockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//        context.startActivity(clockIntent);

        NotificationUtils.NotificationManger(context, intent);
    }







}
